package com.e3.template.tgf;

import java.util.ArrayList;
import java.util.List;

import com.e3.web.core.model.SuperModel;


public abstract class GFHelper<D extends SuperModel> {
	
	private List<String> notNullFieldList;
	
	public boolean isNotNullField(String name){
		if(notNullFieldList == null){
			String[] navFields = getNotNullFieldNames();
			notNullFieldList = new ArrayList<String>(navFields.length);
			for (String navField : navFields) {
				notNullFieldList.add(navField);
			}
		}
		return notNullFieldList.contains(name);
	}
	
	public abstract String[] getNotNullFieldNames();
	
	public abstract D createModelInstance();

}
